package cn.itsource.aigou.client;

import cn.itsource.aigou.util.AjaxResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(value = "COMMON-SERVICE",fallbackFactory = RedisClientFallBackFactory.class)
@Component
public interface RedisClient {

    /**
     * 设置值
     * @param key
     * @param value
     */
    @PostMapping("/redis")
    public AjaxResult set(@RequestParam("key") String key, @RequestParam("value") String value);

    @GetMapping("/redis")
    public String get(@RequestParam("key") String key);

}
